package com.iteaching.common.body;

import java.util.HashMap;
import java.util.Map;

import org.json.JSONException;

import com.iteaching.json.JsonUtils;

public class LoginResult {
	private int resultCode;
	private int userid;
	private String type;
	private Double mark;
	private int mystatus;
	private int toid;
	private String phoneNumber;
	private String alias;
	private String profile;
	private String userName;
	private String userLocation;
	public int getResultCode() {
		return resultCode;
	}
	public void setResultCode(int resultCode) {
		this.resultCode = resultCode;
	}
	public int getUserid() {
		return userid;
	}
	public void setUserid(int userid) {
		this.userid = userid;
	}
	public String getType() {
		return type;
	}
	public void setType(String type) {
		this.type = type;
	}
	public LoginResult(){
		
	}
	public LoginResult(String jsonString){
		Map<String,Object> map=new HashMap<String, Object>();
		try {
			map=JsonUtils.getMap(jsonString);
			resultCode=Integer.valueOf(map.get("resultCode").toString());
			mystatus=Integer.valueOf(map.get("mystatus").toString());
			toid=Integer.valueOf(map.get("toid").toString());
			userid=Integer.valueOf(map.get("userid").toString());
			type=(String)map.get("type");
			mark=Double.valueOf(map.get("mark").toString());
			if(map.get("userName")!=null){
				userName=(String)map.get("userName");
			}
			else{
				userName="";
			}
			if(map.get("userLocation")!=null)
			{
				userLocation=(String)map.get("userLocation");
			}
			else{
				userLocation="";
			}
			if(map.get("profile")!=null){
				profile=(String)map.get("profile");
			}
			else{
				profile="";
			}
			if(map.get("phoneNumber")!=null){
				phoneNumber=(String)map.get("phoneNumber");
			}else{
				phoneNumber="";
			}
			if(map.get("alias")!=null){
				alias=(String)map.get("alias");
			}
			else{
				alias="";
			}
		} catch (JSONException e) {
			e.printStackTrace();
		}
	}
	public String getUserLocation() {
		return userLocation;
	}
	public void setUserLocation(String userLocation) {
		this.userLocation = userLocation;
	}
	public String getUserName() {
		return userName;
	}
	public void setUserName(String userName) {
		this.userName = userName;
	}
	public Double getMark() {
		return mark;
	}
	public void setMark(Double mark) {
		this.mark = mark;
	}
	public String getPhoneNumber() {
		return phoneNumber;
	}
	public void setPhoneNumber(String phoneNumber) {
		this.phoneNumber = phoneNumber;
	}
	public String getAlias() {
		return alias;
	}
	public void setAlias(String alias) {
		this.alias = alias;
	}
	public String getProfile() {
		return profile;
	}
	public void setProfile(String profile) {
		this.profile = profile;
	}
	public int getMystatus() {
		return mystatus;
	}
	public void setMystatus(int mystatus) {
		this.mystatus = mystatus;
	}
	public int getToid() {
		return toid;
	}
	public void setToid(int toid) {
		this.toid = toid;
	}
}
